3.9 \(\int (c+d x)^4 \cos ^2(a+b x) \, dx\)
Optimal. Leaf size=161 \[ -\frac{3 d^3 (c+d x) \cos ^2(a+b x)}{2 b^4}-\frac{3 d^2 (c+d x)^2 \sin (a+b x) \cos (a+b x)}{2 b^3}+\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}+\frac{3 d^4 \sin (a+b x) \cos (a+b x)}{4 b^5}+\frac{(c+d x)^4 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{d (c+d x)^3}{2 b^2}+\frac{3 d^4 x}{4 b^4}+\frac{(c+d x)^5}{10 d} \]
[Out]
(3*d^4*x)/(4*b^4) - (d*(c + d*x)^3)/(2*b^2) + (c + d*x)^5/(10*d) - (3*d^3*(c + d*x)*Cos[a + b*x]^2)/(2*b^4) +
(d*(c + d*x)^3*Cos[a + b*x]^2)/b^2 + (3*d^4*Cos[a + b*x]*Sin[a + b*x])/(4*b^5) - (3*d^2*(c + d*x)^2*Cos[a + b*
x]*Sin[a + b*x])/(2*b^3) + ((c + d*x)^4*Cos[a + b*x]*Sin[a + b*x])/(2*b)
________________________________________________________________________________________
Rubi [A] time = 0.101873, antiderivative size = 161, normalized size of antiderivative = 1.,
number of steps used = 6, number of rules used = 4, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used =
{3311, 32, 2635, 8} \[ -\frac{3 d^3 (c+d x) \cos ^2(a+b x)}{2 b^4}-\frac{3 d^2 (c+d x)^2 \sin (a+b x) \cos (a+b x)}{2 b^3}+\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}+\frac{3 d^4 \sin (a+b x) \cos (a+b x)}{4 b^5}+\frac{(c+d x)^4 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{d (c+d x)^3}{2 b^2}+\frac{3 d^4 x}{4 b^4}+\frac{(c+d x)^5}{10 d} \]
Antiderivative was successfully verified.
[In]
Int[(c + d*x)^4*Cos[a + b*x]^2,x]
[Out]
(3*d^4*x)/(4*b^4) - (d*(c + d*x)^3)/(2*b^2) + (c + d*x)^5/(10*d) - (3*d^3*(c + d*x)*Cos[a + b*x]^2)/(2*b^4) +
(d*(c + d*x)^3*Cos[a + b*x]^2)/b^2 + (3*d^4*Cos[a + b*x]*Sin[a + b*x])/(4*b^5) - (3*d^2*(c + d*x)^2*Cos[a + b*
x]*Sin[a + b*x])/(2*b^3) + ((c + d*x)^4*Cos[a + b*x]*Sin[a + b*x])/(2*b)
Rule 3311
Int[((c_.) + (d_.)*(x_))^(m_)*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*m*(c + d*x)^(m - 1)*(
b*Sin[e + f*x])^n)/(f^2*n^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)^m*(b*Sin[e + f*x])^(n - 2), x], x] - D
ist[(d^2*m*(m - 1))/(f^2*n^2), Int[(c + d*x)^(m - 2)*(b*Sin[e + f*x])^n, x], x] - Simp[(b*(c + d*x)^m*Cos[e +
f*x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1] && GtQ[m, 1]
Rule 32
Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]
Rule 2635
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]
Rule 8
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
Rubi steps
\begin{align*} \int (c+d x)^4 \cos ^2(a+b x) \, dx &=\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}+\frac{(c+d x)^4 \cos (a+b x) \sin (a+b x)}{2 b}+\frac{1}{2} \int (c+d x)^4 \, dx-\frac{\left (3 d^2\right ) \int (c+d x)^2 \cos ^2(a+b x) \, dx}{b^2}\\ &=\frac{(c+d x)^5}{10 d}-\frac{3 d^3 (c+d x) \cos ^2(a+b x)}{2 b^4}+\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}-\frac{3 d^2 (c+d x)^2 \cos (a+b x) \sin (a+b x)}{2 b^3}+\frac{(c+d x)^4 \cos (a+b x) \sin (a+b x)}{2 b}-\frac{\left (3 d^2\right ) \int (c+d x)^2 \, dx}{2 b^2}+\frac{\left (3 d^4\right ) \int \cos ^2(a+b x) \, dx}{2 b^4}\\ &=-\frac{d (c+d x)^3}{2 b^2}+\frac{(c+d x)^5}{10 d}-\frac{3 d^3 (c+d x) \cos ^2(a+b x)}{2 b^4}+\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}+\frac{3 d^4 \cos (a+b x) \sin (a+b x)}{4 b^5}-\frac{3 d^2 (c+d x)^2 \cos (a+b x) \sin (a+b x)}{2 b^3}+\frac{(c+d x)^4 \cos (a+b x) \sin (a+b x)}{2 b}+\frac{\left (3 d^4\right ) \int 1 \, dx}{4 b^4}\\ &=\frac{3 d^4 x}{4 b^4}-\frac{d (c+d x)^3}{2 b^2}+\frac{(c+d x)^5}{10 d}-\frac{3 d^3 (c+d x) \cos ^2(a+b x)}{2 b^4}+\frac{d (c+d x)^3 \cos ^2(a+b x)}{b^2}+\frac{3 d^4 \cos (a+b x) \sin (a+b x)}{4 b^5}-\frac{3 d^2 (c+d x)^2 \cos (a+b x) \sin (a+b x)}{2 b^3}+\frac{(c+d x)^4 \cos (a+b x) \sin (a+b x)}{2 b}\\ \end{align*}
Mathematica [A] time = 0.657682, size = 132, normalized size = 0.82 \[ \frac{10 \sin (2 (a+b x)) \left (-6 b^2 d^2 (c+d x)^2+2 b^4 (c+d x)^4+3 d^4\right )+20 b d (c+d x) \cos (2 (a+b x)) \left (2 b^2 (c+d x)^2-3 d^2\right )+8 b^5 x \left (10 c^2 d^2 x^2+10 c^3 d x+5 c^4+5 c d^3 x^3+d^4 x^4\right )}{80 b^5} \]
Antiderivative was successfully verified.
[In]
Integrate[(c + d*x)^4*Cos[a + b*x]^2,x]
[Out]
(8*b^5*x*(5*c^4 + 10*c^3*d*x + 10*c^2*d^2*x^2 + 5*c*d^3*x^3 + d^4*x^4) + 20*b*d*(c + d*x)*(-3*d^2 + 2*b^2*(c +
d*x)^2)*Cos[2*(a + b*x)] + 10*(3*d^4 - 6*b^2*d^2*(c + d*x)^2 + 2*b^4*(c + d*x)^4)*Sin[2*(a + b*x)])/(80*b^5)
________________________________________________________________________________________
Maple [B] time = 0.047, size = 1027, normalized size = 6.4 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((d*x+c)^4*cos(b*x+a)^2,x)
[Out]
1/b*(1/b^4*d^4*((b*x+a)^4*(1/2*cos(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a)+(b*x+a)^3*cos(b*x+a)^2-3*(b*x+a)^2*(1/2*co
s(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a)-3/2*(b*x+a)*cos(b*x+a)^2+3/4*cos(b*x+a)*sin(b*x+a)+3/4*b*x+3/4*a+(b*x+a)^3-
2/5*(b*x+a)^5)-4/b^4*a*d^4*((b*x+a)^3*(1/2*cos(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a)+3/4*(b*x+a)^2*cos(b*x+a)^2-3/2
*(b*x+a)*(1/2*cos(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a)+3/8*(b*x+a)^2+3/8*sin(b*x+a)^2-3/8*(b*x+a)^4)+4/b^3*c*d^3*(
(b*x+a)^3*(1/2*cos(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a)+3/4*(b*x+a)^2*cos(b*x+a)^2-3/2*(b*x+a)*(1/2*cos(b*x+a)*sin
(b*x+a)+1/2*b*x+1/2*a)+3/8*(b*x+a)^2+3/8*sin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*sin(b*x+a)+1/2*b*x+1/2*a)+c^4*(1/2*cos(b*x+a)*sin(b*x+a)+1/2*b*x+1/2*a))
________________________________________________________________________________________
Maxima [B] time = 1.18895, size = 968, normalized size = 6.01 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((d*x+c)^4*cos(b*x+a)^2,x, algorithm="maxima")
[Out]
1/40*(10*(2*b*x + 2*a + sin(2*b*x + 2*a))*c^4 - 40*(2*b*x + 2*a + sin(2*b*x + 2*a))*a*c^3*d/b + 60*(2*b*x + 2*
a + sin(2*b*x + 2*a))*a^2*c^2*d^2/b^2 - 40*(2*b*x + 2*a + sin(2*b*x + 2*a))*a^3*c*d^3/b^3 + 10*(2*b*x + 2*a +
sin(2*b*x + 2*a))*a^4*d^4/b^4 + 20*(2*(b*x + a)^2 + 2*(b*x + a)*sin(2*b*x + 2*a) + cos(2*b*x + 2*a))*c^3*d/b -
60*(2*(b*x + a)^2 + 2*(b*x + a)*sin(2*b*x + 2*a) + cos(2*b*x + 2*a))*a*c^2*d^2/b^2 + 60*(2*(b*x + a)^2 + 2*(b
*x + a)*sin(2*b*x + 2*a) + cos(2*b*x + 2*a))*a^2*c*d^3/b^3 - 20*(2*(b*x + a)^2 + 2*(b*x + a)*sin(2*b*x + 2*a)
+ cos(2*b*x + 2*a))*a^3*d^4/b^4 + 10*(4*(b*x + a)^3 + 6*(b*x + a)*cos(2*b*x + 2*a) + 3*(2*(b*x + a)^2 - 1)*sin
(2*b*x + 2*a))*c^2*d^2/b^2 - 20*(4*(b*x + a)^3 + 6*(b*x + a)*cos(2*b*x + 2*a) + 3*(2*(b*x + a)^2 - 1)*sin(2*b*
x + 2*a))*a*c*d^3/b^3 + 10*(4*(b*x + a)^3 + 6*(b*x + a)*cos(2*b*x + 2*a) + 3*(2*(b*x + a)^2 - 1)*sin(2*b*x + 2
*a))*a^2*d^4/b^4 + 10*(2*(b*x + a)^4 + 3*(2*(b*x + a)^2 - 1)*cos(2*b*x + 2*a) + 2*(2*(b*x + a)^3 - 3*b*x - 3*a
)*sin(2*b*x + 2*a))*c*d^3/b^3 - 10*(2*(b*x + a)^4 + 3*(2*(b*x + a)^2 - 1)*cos(2*b*x + 2*a) + 2*(2*(b*x + a)^3
- 3*b*x - 3*a)*sin(2*b*x + 2*a))*a*d^4/b^4 + (4*(b*x + a)^5 + 10*(2*(b*x + a)^3 - 3*b*x - 3*a)*cos(2*b*x + 2*a
) + 5*(2*(b*x + a)^4 - 6*(b*x + a)^2 + 3)*sin(2*b*x + 2*a))*d^4/b^4)/b
________________________________________________________________________________________
Fricas [A] time = 1.16394, size = 593, normalized size = 3.68 \begin{align*} \frac{2 \, b^{5} d^{4} x^{5} + 10 \, b^{5} c d^{3} x^{4} + 10 \,{\left (2 \, b^{5} c^{2} d^{2} - b^{3} d^{4}\right )} x^{3} + 10 \,{\left (2 \, b^{5} c^{3} d - 3 \, b^{3} c d^{3}\right )} x^{2} + 10 \,{\left (2 \, b^{3} d^{4} x^{3} + 6 \, b^{3} c d^{3} x^{2} + 2 \, b^{3} c^{3} d - 3 \, b c d^{3} + 3 \,{\left (2 \, b^{3} c^{2} d^{2} - b d^{4}\right )} x\right )} \cos \left (b x + a\right )^{2} + 5 \,{\left (2 \, b^{4} d^{4} x^{4} + 8 \, b^{4} c d^{3} x^{3} + 2 \, b^{4} c^{4} - 6 \, b^{2} c^{2} d^{2} + 3 \, d^{4} + 6 \,{\left (2 \, b^{4} c^{2} d^{2} - b^{2} d^{4}\right )} x^{2} + 4 \,{\left (2 \, b^{4} c^{3} d - 3 \, b^{2} c d^{3}\right )} x\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 5 \,{\left (2 \, b^{5} c^{4} - 6 \, b^{3} c^{2} d^{2} + 3 \, b d^{4}\right )} x}{20 \, b^{5}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((d*x+c)^4*cos(b*x+a)^2,x, algorithm="fricas")
[Out]
1/20*(2*b^5*d^4*x^5 + 10*b^5*c*d^3*x^4 + 10*(2*b^5*c^2*d^2 - b^3*d^4)*x^3 + 10*(2*b^5*c^3*d - 3*b^3*c*d^3)*x^2
+ 10*(2*b^3*d^4*x^3 + 6*b^3*c*d^3*x^2 + 2*b^3*c^3*d - 3*b*c*d^3 + 3*(2*b^3*c^2*d^2 - b*d^4)*x)*cos(b*x + a)^2
+ 5*(2*b^4*d^4*x^4 + 8*b^4*c*d^3*x^3 + 2*b^4*c^4 - 6*b^2*c^2*d^2 + 3*d^4 + 6*(2*b^4*c^2*d^2 - b^2*d^4)*x^2 +
4*(2*b^4*c^3*d - 3*b^2*c*d^3)*x)*cos(b*x + a)*sin(b*x + a) + 5*(2*b^5*c^4 - 6*b^3*c^2*d^2 + 3*b*d^4)*x)/b^5
________________________________________________________________________________________
Sympy [A] time = 5.98816, size = 660, normalized size = 4.1 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((d*x+c)**4*cos(b*x+a)**2,x)
[Out]
Piecewise((c**4*x*sin(a + b*x)**2/2 + c**4*x*cos(a + b*x)**2/2 + c**3*d*x**2*sin(a + b*x)**2 + c**3*d*x**2*cos
(a + b*x)**2 + c**2*d**2*x**3*sin(a + b*x)**2 + c**2*d**2*x**3*cos(a + b*x)**2 + c*d**3*x**4*sin(a + b*x)**2/2
+ c*d**3*x**4*cos(a + b*x)**2/2 + d**4*x**5*sin(a + b*x)**2/10 + d**4*x**5*cos(a + b*x)**2/10 + c**4*sin(a +
b*x)*cos(a + b*x)/(2*b) + 2*c**3*d*x*sin(a + b*x)*cos(a + b*x)/b + 3*c**2*d**2*x**2*sin(a + b*x)*cos(a + b*x)/
b + 2*c*d**3*x**3*sin(a + b*x)*cos(a + b*x)/b + d**4*x**4*sin(a + b*x)*cos(a + b*x)/(2*b) + c**3*d*cos(a + b*x
)**2/b**2 - 3*c**2*d**2*x*sin(a + b*x)**2/(2*b**2) + 3*c**2*d**2*x*cos(a + b*x)**2/(2*b**2) - 3*c*d**3*x**2*si
n(a + b*x)**2/(2*b**2) + 3*c*d**3*x**2*cos(a + b*x)**2/(2*b**2) - d**4*x**3*sin(a + b*x)**2/(2*b**2) + d**4*x*
*3*cos(a + b*x)**2/(2*b**2) - 3*c**2*d**2*sin(a + b*x)*cos(a + b*x)/(2*b**3) - 3*c*d**3*x*sin(a + b*x)*cos(a +
b*x)/b**3 - 3*d**4*x**2*sin(a + b*x)*cos(a + b*x)/(2*b**3) - 3*c*d**3*cos(a + b*x)**2/(2*b**4) + 3*d**4*x*sin
(a + b*x)**2/(4*b**4) - 3*d**4*x*cos(a + b*x)**2/(4*b**4) + 3*d**4*sin(a + b*x)*cos(a + b*x)/(4*b**5), Ne(b, 0
)), ((c**4*x + 2*c**3*d*x**2 + 2*c**2*d**2*x**3 + c*d**3*x**4 + d**4*x**5/5)*cos(a)**2, True))
________________________________________________________________________________________
Giac [A] time = 1.10143, size = 300, normalized size = 1.86 \begin{align*} \frac{1}{10} \, d^{4} x^{5} + \frac{1}{2} \, c d^{3} x^{4} + c^{2} d^{2} x^{3} + c^{3} d x^{2} + \frac{1}{2} \, c^{4} x + \frac{{\left (2 \, b^{3} d^{4} x^{3} + 6 \, b^{3} c d^{3} x^{2} + 6 \, b^{3} c^{2} d^{2} x + 2 \, b^{3} c^{3} d - 3 \, b d^{4} x - 3 \, b c d^{3}\right )} \cos \left (2 \, b x + 2 \, a\right )}{4 \, b^{5}} + \frac{{\left (2 \, b^{4} d^{4} x^{4} + 8 \, b^{4} c d^{3} x^{3} + 12 \, b^{4} c^{2} d^{2} x^{2} + 8 \, b^{4} c^{3} d x + 2 \, b^{4} c^{4} - 6 \, b^{2} d^{4} x^{2} - 12 \, b^{2} c d^{3} x - 6 \, b^{2} c^{2} d^{2} + 3 \, d^{4}\right )} \sin \left (2 \, b x + 2 \, a\right )}{8 \, b^{5}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((d*x+c)^4*cos(b*x+a)^2,x, algorithm="giac")
[Out]
1/10*d^4*x^5 + 1/2*c*d^3*x^4 + c^2*d^2*x^3 + c^3*d*x^2 + 1/2*c^4*x + 1/4*(2*b^3*d^4*x^3 + 6*b^3*c*d^3*x^2 + 6*
b^3*c^2*d^2*x + 2*b^3*c^3*d - 3*b*d^4*x - 3*b*c*d^3)*cos(2*b*x + 2*a)/b^5 + 1/8*(2*b^4*d^4*x^4 + 8*b^4*c*d^3*x
^3 + 12*b^4*c^2*d^2*x^2 + 8*b^4*c^3*d*x + 2*b^4*c^4 - 6*b^2*d^4*x^2 - 12*b^2*c*d^3*x - 6*b^2*c^2*d^2 + 3*d^4)*
sin(2*b*x + 2*a)/b^5